<?php

namespace App\Models;

use \Illuminate\Database\Eloquent\Model;

class Goods extends Model
{
    protected $table = 'tb_goods';// 表名
    public $fillable = ['goods_id', 'name', 'price', 'pic', 'details', 'type_id'];
    public $timestamps = false;// 关闭后  create方法不会修改 created_at updated_at 的值

    public $primaryKey = 'goods_id';//主键默认是id  不是的话需要配置

    public function matches()
    {
        return $this->hasMany(Match::class, 'goods_id', 'goods_id');
    }


}